﻿<%@ Page Language="C#" MasterPageFile="~/PresentationLayer/Split.Master" AutoEventWireup="true"
    CodeBehind="Registo.aspx.cs" Inherits="Distrackting.PresentationLayer.Registo"
    Title="Distrackting: Registo" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 200px;
        }
        .style2
        {
            width: 156px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="side" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rest" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:ObjectDataSource ID="LocalidadesDataSource" runat="server" SelectMethod="getLocalidades"
        TypeName="Distrackting.BusinessLayer.GerirLocalidade"></asp:ObjectDataSource>
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
        OnCreatingUser="CreateUserWizard1_CreatingUser" 
        CompleteSuccessText="A sua conta foi criada com sucesso." 
        DuplicateEmailErrorMessage="Já existe uma Conta do Distrackting associada a este endereço de e-mail. Por favor introduza outro  endereço de e-mail." 
        DuplicateUserNameErrorMessage="Por favor introduza outro nome de utilizador." 
        InvalidAnswerErrorMessage="Por favor introduza outra resposta para a pergunta de segurança." 
        InvalidEmailErrorMessage="Por favor introduza um endereço de e-mail válido." 
        InvalidPasswordErrorMessage="Deve conter pelo menos 4 caracteres." 
        InvalidQuestionErrorMessage="Por favor introduza outra pergunta de segurança." 
        UnknownErrorMessage="Sua conta não foi criada. Por favor tente de novo." 
        oncontinuebuttonclick="CreateUserWizard1_ContinueButtonClick">
        <WizardSteps>
            <asp:CreateUserWizardStep runat="server">
                <ContentTemplate>
                    <table border="0">
                        <tr>
                            <td align="center" colspan="2">
                                <h1>Criar nova conta</h1>
                                <asp:TextBox ID="UserName" runat="server" Visible="false"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="EmailLabel">E-mail:</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                    ErrorMessage="É necessário inserir o e-mail." ToolTip="É necessário inserir o e-mail."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                    ErrorMessage="É necessário inserir password." ToolTip="É necessário inserir password."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm 
                                Password:</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
                                    ErrorMessage="É necessário confirmar a password." ToolTip="É necessário confirmar a password."
                                    ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="Label1" runat="server" AssociatedControlID="Name">Nome:</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:TextBox ID="Name" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Email"
                                    ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="EmailRequired_ValidatorCalloutExtender" runat="server"
                                    Enabled="True" TargetControlID="EmailRequired">
                                </cc1:ValidatorCalloutExtender>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="Label2" runat="server" AssociatedControlID="Dia">Data de 
                                Nascimento(dd/mm/aa):</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:TextBox ID="Dia" runat="server" Width="30px"></asp:TextBox>/
                                <asp:TextBox ID="Mes" runat="server" Width="30px"></asp:TextBox>/
                                <asp:TextBox ID="Ano" runat="server" Width="30px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="Label3" runat="server" AssociatedControlID="Sexo">Sexo:</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:DropDownList ID="Sexo" runat="server">
                                    <asp:ListItem Value="M">Masculino</asp:ListItem>
                                    <asp:ListItem Value="F">Feminino</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="Label4" runat="server" AssociatedControlID="Telemovel">Telemóvel:</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:TextBox ID="Telemovel" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1">
                                <asp:Label ID="Label5" runat="server" AssociatedControlID="Localidade">Localidade:</asp:Label>
                            </td>
                            <td class="style2">
                                <asp:DropDownList ID="Localidade" runat="server" DataSourceID="LocalidadesDataSource"
                                    DataTextField="nome" DataValueField="cod_localidade">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2">
                                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                                    ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="A password e a confirmação da password devem corresponder."
                                    ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2" style="color: Red;">
                                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:CreateUserWizardStep>
            <asp:CompleteWizardStep runat="server" />
        </WizardSteps>
    </asp:CreateUserWizard>
</asp:Content>
